@extends('layouts.app')
@section('title',$user->name.'的个人信息编辑页')

@section('content')
    <div class="row">
        <div class="offset-md-2 col-md-8">
            <div class="card">
                <div class="card-header">
                    <h3 class="text-center pt-3">
                        <i class="fa-solid fa-pen-to-square"></i>
                        编辑信息
                    </h3>
                </div>
                <div class="card-body">
                    <form action="{{route('users.update',$user->id)}}" method="POST" accept-charset="UTF-8" enctype="multipart/form-data">
                        @csrf
                        {{method_field('PUT')}}
                        @include('Shared._error')
                        <div class="form-group">
                            <label for="name" class="form-label">用户名</label>
                            <input type="text" class="form-control" id="name"
                                   name="name"
                                   placeholder="请输入用户名"
                                   value="{{old("name",$user->name)}}">
                        </div>
                        <div class="form-group">
                            <label for="email" class="form-label">邮箱</label>
                            <input type="email" class="form-control" id="email"
                                   disabled  value="{{old('email',$user->email)}}">
                        </div>
                        <div class="form-group">
                            <label for="introduction" class="form-label">个人简介</label>
                            <textarea class="form-control" id="introduction" name="introduction" >
                                {{old('introduction',$user->introduction)}}
                            </textarea>
                        </div>
                        <div class="form-group">
                            <label for="avatar" class="form-label">头像</label>
                            <input type="file" name="avatar" class="form-control" id="avatar"
                            >
                        </div>
                        <hr>
                        <div class="text-center">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@stop
